#!/usr/bin/python
import socket
import time
import struct
import os

VERSION = 0x00020001
MODULE_LOGIN_REQ = 0x00006001
MODULE_LOGIN_RESP = 0x00006002
HEARTBEAT_LINK_REQ = 0x00006005
HEARTBEAT_LINK_RESP = 0x00006006
SMS_RECV_REQ = 0x00076001

if __name__ == '__main__':
	sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)  
	sock.connect(('127.0.0.1', 9999))  
	version = VERSION 
	command = HEARTBEAT_LINK_REQ
	length  = 0
	sequence = 0 
	status	= 0

	#buf = struct.pack("IIIII",version,command,length,sequence,status)

	#sock.send(buf)  

	while True:
		buf = struct.pack("IIIII",version,command,length,sequence,status)
		sequence=sequence + 1
		sock.send(buf)  

		#buf_recv = sock.recv(struct.calcsize("IIIII"));
		time.sleep(3) 


	sock.close()
